﻿<%@ Page Title="" Language="C#" MasterPageFile="~/PortalParts/PageMore.Master" AutoEventWireup="true" CodeBehind="PartyMessageBoxMore.aspx.cs" Inherits="ZHDJ.Web.Portal.MessageBox.PartyMessageBoxMore" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
    <script src="../../Resource/js/default/jquery.tmpl.min.js"></script>
    <script src="../../Resource/js/knockout/knockout-3.4.0.js"></script>
    
    <script src="../../Resource/js/jquery/jquery.pagination.js"></script>
    <script>
        var pageSize = 10, isBind = false;
        var paginationPara = {
            num_edge_entries: 1, //边缘页数
            num_display_entries: 4, //主体页数
            callback: pageselectCallback,
            items_per_page: pageSize, //每页显示1项
            prev_text: " ",
            next_text: " ",
            link_to: "javascript:void(0);"
        }
        var ViewModel = {
            qdate: ko.observableArray(),
            loadContacts: function (pageIndex) {
                $.get("PartyMessageBoxMore.aspx", {
                    PageIndex: pageIndex ,
                    PageSize: pageSize,
                    QueryText: $("#QueryText").val(),
                    Status: $("#ddlStatus").val(),
                    r: (new Date()).getTime()
                },
                function (data) {
                    ViewModel.qdate(eval("(" + data + ")"));
                });
            }
        }

        function initPage() {
            $.get("PartyMessageBoxMore.aspx", { DataCount: 1, QueryText: $("#QueryText").val(), Status: $("#ddlStatus").val(), r: (new Date()).getTime() },
                function (data) {
                    var totalCount = parseInt(data);
                    $("#pagination").pagination(totalCount, paginationPara);
                });
        }
        function pageselectCallback(pageIndex, jq) {
            ViewModel.loadContacts(pageIndex);
            if (!isBind) {
                ko.applyBindings(ViewModel);
                isBind = true;
            }
        }
        $(function () {
            initPage();
            $("#btnQuery").click(function () {
                initPage();
            });
        });

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:HiddenField ID="hfTotalCount" runat="server" Value="10" />
    <div class="morequerybar">
        <table>
            <tr >
                <td><span>主题：</span></td>
                <td>
                    <input class="text1 " id="QueryText" type="text" style="width: 200px" /></td>
                <td><span>状态：</span></td>
                <td>
                   <select style="width: 200px;" id="ddlStatus" class="ddl1">
                       <option value="1">待回复</option>
                       <option value="4">已回复</option>
                   </select></td>
                <td>
                    <button type="button" class="button orange" id="btnQuery">搜索</button></td>
            </tr>
        </table>
    </div>
    <div class="ny_box cztable" style="">
        <table  style="width:100%" border="0" cellspacing="0" cellpadding="0">
            <tr class="tr_a">
                <td class="td1" style="width: auto;">主题
                </td>
                <td class=" td2" style=" width:70px">状态
                </td>
                <td class=" td2" style="  width:120px">留言时间
                </td>
                <td class=" td2" style="  width:120px">回复时间
                </td>
            </tr>
             <!-- ko foreach: qdate -->
            <tr class="tr_a">
                <td class="td1"  data-bind="text: Title"></td>
                <td  class="td2"  data-bind="text: StatusName"></td>
                <td class="td2"  data-bind="text: CreateTimeEx"></td>
                <td  class="td2" data-bind="text: ReplyTimeEx"></td>
            </tr>
             <!-- /ko -->
            </table>
        <div class="pagination">
            <div id="pagination">
            </div>
        </div>
    </div>

</asp:Content>

